<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>for 循环渲染数组</title>
</head>
<body>
<div id="app">
    <!-- 将数组使用模板差值进行渲染 -->
    <div>{{ nameList }}</div>
    <br>

    <!--  使用模板差值渲染每个元素  -->
    <div>{{ nameList[0] }}</div>
    <div>{{ nameList[1] }}</div>
    <div>{{ nameList[2] }}</div>
    <div>{{ nameList[3] }}</div>

    <br>

    <div v-for="item in nameList">{{ item }}</div>
    <br>
    <div v-for="(item, index) in nameList">{{index}}、{{ item }}</div>

</div>

<script src="../../../../../js/vue.global.js"></script>
<script>
    const app = Vue.createApp({
        data() {
            return {
                nameList: ["小白兔", "小黑兔", "小灰兔", "大灰狼"],
            }
        },
        methods: {}
    })

    app.mount("#app")
</script>
</body>
</html>